package com.huawei.java.pojo;

/**
 * @author henrydai
 * @version 1.0
 * @date 2022/3/15 19:38
 * @description 属性全部public 节约空间时间
 */
public class EdgeNode implements Cloneable, Comparable{

    /**
     * 边缘节点名称
     */
    public String name;

    /**
     * 边缘节点带宽能力
     */
    public Integer capability;

    public Integer freeSpace;

    public EdgeNode(String name, Integer capability) {
        this.name = name;
        this.capability = capability;
        this.freeSpace = capability;
    }

    @Override
    public Object clone()
    {
        EdgeNode node = null;
        try {
            node = (EdgeNode)super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return node;
    }

    @Override
    public int compareTo(Object o) {
        EdgeNode node = (EdgeNode) o;
        return node.freeSpace - this.freeSpace;
    }
}
